package com.apexedu.biz.action;

import com.apexedu.biz.entity.TServiceCodesort;
import com.apexedu.framework.service.BaseService;
import com.apexedu.sys.action.AbstractBaseActionSupport;
import com.apexedu.sys.entity.ApplicationEnum;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;


@SuppressWarnings("serial")
@Component
@Scope("prototype")
public class ServiceCodeSortAction extends AbstractBaseActionSupport {

	/**
	 * 此方法植入service类
	 */
	@Resource(name="serviceCodeSortService")
	public void setBaseService(BaseService baseService){
		super.setBaseService(baseService);
	}

	private TServiceCodesort tserviceCodesort;

	public TServiceCodesort getTserviceCodesort() {
		return tserviceCodesort;
	}

	public void setTserviceCodesort(TServiceCodesort tserviceCodesort) {
		this.tserviceCodesort = tserviceCodesort;
	}

	/**
	 * 系统字典类别
	 *
	 * @return
	 */
	public List<ApplicationEnum> getSysCodeSort() {

		String hql = "select new ApplicationEnum(t.zdlb,t.lbmc) from TServiceCodesort t group by t.zdlb,t.lbmc order by t.zdlb";
		return applicationEnumService.getApplicationEnums(true, hql);
	}
}
